#include<bits/stdc++.h>
using namespace std;
#define int long long

int d[100010];
signed main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        scanf("%lld",&d[i]);
    }
    
    sort(d+1,d+n+1);
    int suma=1,sumb=0;
    bool f=0;
    int ans=n;
    int le=0;
    for(int i=2;i<=n;i++){
        if(d[i]==d[i-1]){
            if(f==0)suma++;
            if(f==1)sumb++;
        }else{
            f=1;
            sumb=1;            
         //   cout<<i<<" "<<sumb<<endl;

        }
        if(d[i]!=d[i+1]&&f==1){
        //    cout<<i<<" "<<sumb<<endl;
        //     if(d[i]==2)cout<<suma<<" "<<sumb<<endl;
            if(sumb>=suma){
                ans-=suma;
                le=0;
                // cout<<suma<<" "<<sumb<<"\n";
            }else if(sumb<suma){
                ans-=sumb;
                le+=(suma-sumb);
                // cout<<le<<" ";
            }
            // if(d[i]==2)cout<<ans<<endl;           
            // if(d[i]==3)cout<<suma<<" "<<sumb<<endl;
            suma=le+sumb;
            sumb=0;
            f=1;
        }
    }
    cout<<ans;
    return 0;
}
